package com.kit.data.kitopeso.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

public class KitoListView extends ListView {

    boolean isTMeasure = true;

    public KitoListView(Context context) {
        super(context);
    }

    public KitoListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public KitoListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public KitoListView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }


    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (isTMeasure) {
            int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                    MeasureSpec.AT_MOST);
            super.onMeasure(widthMeasureSpec, expandSpec);
        } else {
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        }
    }

    public void setTMeasure(boolean TMeasure) {
        isTMeasure = TMeasure;
    }

}
